import Mock from 'mockjs';
import setupMock, { successResponseWrap } from './setup-mock';
import type { AppGroupRecord, AppManagementRecord } from '@/api/app-center';

const appGroupRecordList: AppGroupRecord[] = [
  {
    id: 'ag1',
    name: '文件传输',
    anchor: 'ag1',
    apps: [
      {
        id: 'ag1-01',
        name: '收索文件',
        icon: 'callRecords',
        desc: '收索文件',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag1-02',
        name: '扫码传输',
        icon: 'certification',
        desc: '扫码传输',
        url: 'https://www.baidu.com'
      }
    ]
  },
  {
    id: 'ag2',
    name: '识别转换',
    anchor: 'ag2',
    apps: [
      {
        id: 'ag2-01',
        name: '音频转文字',
        icon: 'collect',
        desc: '音频转文字',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag2-02',
        name: 'PDF转Word',
        icon: 'deviceMenage',
        desc: 'PDF转Word',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag2-03',
        name: '图片转PDF',
        icon: 'diskClear',
        desc: '图片转PDF',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag2-04',
        name: '图片转Word',
        icon: 'duplicateCheck',
        desc: '图片转Word',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag2-05',
        name: '图片压缩',
        icon: 'callRecords',
        desc: '图片压缩',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag2-06',
        name: '图片滤镜',
        icon: 'certification',
        desc: '图片滤镜',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag2-07',
        name: '图片转Excel',
        icon: 'deviceMenage',
        desc: '图片转Excel',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag2-08',
        name: '文字识别',
        icon: 'collect',
        desc: '文字识别',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag2-09',
        name: '试卷去手写',
        icon: 'deviceMenage',
        desc: '试卷去手写',
        url: 'https://www.baidu.com'
      }
    ]
  },
  {
    id: 'ag3',
    name: '效率助手',
    anchor: 'ag3',
    apps: [
      {
        id: 'ag3-01',
        name: '实时录音',
        icon: 'collect',
        desc: '实时录音',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag3-02',
        name: '论文查重',
        icon: 'collect',
        desc: '论文查重',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag3-03',
        name: '线上打印',
        icon: 'collect',
        desc: '线上打印',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag3-04',
        name: '记事本',
        icon: 'collect',
        desc: '记事本',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag3-05',
        name: '印象笔记',
        icon: 'collect',
        desc: '印象笔记',
        url: 'https://www.baidu.com'
      },
      { id: 'ag3-06', name: '检题', icon: 'collect', desc: '检题', url: 'https://www.baidu.com' },
      {
        id: 'ag3-07',
        name: '智能PPT',
        icon: 'collect',
        desc: '智能PPT',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag3-08',
        name: '自由画布',
        icon: 'collect',
        desc: '自由画布',
        url: 'https://www.baidu.com'
      }
    ]
  },
  {
    id: 'ag4',
    name: '文件管理',
    anchor: 'ag4',
    apps: [
      {
        id: 'ag4-01',
        name: '垃圾文件清理',
        icon: 'duplicateCheck',
        desc: '垃圾文件清理',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag4-02',
        name: '设备管理',
        icon: 'deviceMenage',
        desc: '设备管理',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag4-03',
        name: '导出文件目录',
        icon: 'duplicateCheck',
        desc: '导出文件目录',
        url: 'https://www.baidu.com'
      }
    ]
  },
  {
    id: 'ag5',
    name: '数据备份',
    anchor: 'ag5',
    apps: [
      {
        id: 'ag5-01',
        name: '通讯录',
        icon: 'deviceMenage',
        desc: '通讯录',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag5-02',
        name: '短信',
        icon: 'callRecords',
        desc: '短信',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag5-03',
        name: '通话记录',
        icon: 'callRecords',
        desc: '通话记录',
        url: 'https://www.baidu.com'
      },
      {
        id: 'ag5-04',
        name: '一刻相册',
        icon: 'deviceMenage',
        desc: '一刻相册',
        url: 'https://www.baidu.com'
      }
    ]
  },
  {
    id: 'ag6',
    name: '企业服务',
    anchor: 'ag6',
    apps: []
  },
  {
    id: 'ag7',
    name: '其他',
    anchor: 'ag7',
    apps: []
  }
];

const appManagementRecordList: AppManagementRecord[] = [
  {
    id: '54c4f2754e0d4b289179bdf5585eeb09',
    model: 'model-name',
    name: '收索文件',
    icon: 'callRecords',
    status: '已安装',
    tags: [
      {
        label: '文件传输',
        color: 'orange'
      },
      {
        label: '文件管理',
        color: 'blue'
      }
    ]
  },
  {
    id: '54c4f2754e0d4b289179bdf5585eeb10',
    model: 'model-name',
    name: '收索文件',
    icon: 'callRecords',
    status: '已安装',
    tags: [
      {
        label: '文件传输',
        color: 'orange'
      },
      {
        label: '文件管理',
        color: 'blue'
      }
    ]
  },
  {
    id: '54c4f2754e0d4b289179bdf5585eeb101',
    model: 'model-name',
    name: '收索文件',
    icon: 'callRecords',
    status: '已安装',
    tags: [
      {
        label: '文件传输',
        color: 'orange'
      },
      {
        label: '文件管理',
        color: 'blue'
      }
    ]
  },
  {
    id: '54c4f2754e0d4b289179bdf5585eeb102',
    model: 'model-name',
    name: '收索文件',
    icon: 'callRecords',
    status: '已安装',
    tags: [
      {
        label: '文件传输',
        color: 'orange'
      },
      {
        label: '文件管理',
        color: 'blue'
      }
    ]
  },
  {
    id: '54c4f2754e0d4b289179bdf5585eeb103',
    model: 'model-name',
    name: '收索文件',
    icon: 'callRecords',
    status: '已安装',
    tags: [
      {
        label: '文件传输',
        color: 'orange'
      },
      {
        label: '文件管理',
        color: 'blue'
      }
    ]
  },
  {
    id: '54c4f2754e0d4b289179bdf5585eeb104',
    model: 'model-name',
    name: '收索文件',
    icon: 'callRecords',
    status: '已安装',
    tags: [
      {
        label: '文件传输',
        color: 'orange'
      },
      {
        label: '文件管理',
        color: 'blue'
      }
    ]
  }
];
setupMock({
  setup() {
    // Quality Inspection
    Mock.mock(new RegExp('/api/apps/list'), () => {
      return successResponseWrap(appGroupRecordList);
    });
    Mock.mock(new RegExp('/api/appmanagement/list'), () => {
      return successResponseWrap(appManagementRecordList);
    });
  }
});
